# -*- coding: utf-8 -*-

import argparse
from train import train, save_model, load_model, evaluate
from utils import init_logger, get_args
from predict import Query


def main(args):
    init_logger()

    if args.do_train:
        model = train(args)
        save_model(model, args)

    if args.do_eval:
        model = load_model(args)
        # model = train(args)
        evaluate(model, args)

    if args.do_predict:
        model = load_model(args)
        # model = train(args)
        query = Query(args, model)
        query.get_predict()


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    args = get_args(parser)
    main(args)
